package models;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.ManyToAny;

import play.db.jpa.Model;
@Entity
@Table(name = "product")
public class Product extends Model{
	@Column(name = "PRODUCTNO")
	public String productno;
	@Column(name = "PRODUCTNAME")
	public String productName;
	@Column(name = "DESCRIPTION")
	public String description;
	@Column(name = "PRICE")
	public double price;
	@Column(name = "PRODUCTTYPE_ID" )
	public long producttype_id;
	
	public  String getPuductTypeName(long id){
		ProductType productType=ProductType.find("id=?",id).first();
		return productType.producttypename;

	}

}
